
package com.hkfn.rfb.common.view;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.hkfn.rfb.R;
import com.hkfn.rfb.common.utils.GildeUtils;

public class InitView {
    private static InitView initView;

    public static InitView instance() {
        if (initView == null) {
            initView = new InitView();
        }
        return initView;
    }

    /**
     * 设置下拉刷新控件
     * 
     * @param swipeLayout
     */
    public void initSuperSwipeLayout(SuperSwipeRefreshLayout swipeLayout){
        swipeLayout.setHeaderViewBackgroundColor(0xffffffff);
        swipeLayout.setTargetScrollWithLayout(true);
        swipeLayout.setDefaultHeaderView();
        swipeLayout.setOnDefaultPullRefreshListener();
    }


    public void initProgressBar(Context context, View view){
        ImageView iv_progress = view.findViewById(R.id.iv_progress);
        GildeUtils.loadImageAsGif(context, iv_progress, R.drawable.loading);
    }
}
